<?php 
class getJsonAction extends AdminMaster{
	public function showList(){
		$json = array('status' => '1', 'data' => array());
		$cate_id = intval($this->getRequest()->getParameter('cate_id', -1));
		if($cate_id > 0){
			switch ($this->data['action']){
				case 'area':
					$arr = LocationAreas::getDataListFrontEnd();
					foreach($arr as $ar){
						$json['data'][] = array('id' => $ar['id'], 'name' => $ar['name']);
					}
					break;
				case 'province':
					$arr = LocationProvinces::getDataListFrontEnd(array('filter_location_area_id' => $cate_id));
					foreach($arr as $ar){
						$json['data'][] = array('id' => $ar['id'], 'name' => $ar['name']);
					}
					break;
				case 'district':
					$arr = LocationDistricts::getDataListFrontEnd(array('filter_location_province_id' => $cate_id));
					foreach($arr as $ar){
						$json['data'][] = array('id' => $ar['id'], 'name' => $ar['name']);
					}
					break;
			}
		}
		print_r(json_encode($json));
		die;
	}
	
}